<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 
<%@ page
	import="com.bisoubeaute.cake.model.order.OrderModel,com.bisoubeaute.cake.model.order.OrderDetailsModel"
	language="java"%>
<%
    String basePath = request.getContextPath();
%>
<!DOCTYPE html>
<html>
	<head>		
		<meta http-equiv="X-UA-Compatible" content="IE=7, IE=9">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
		<link rel="icon" href="http://wechat.monmondecake.com/monmomde/cakewap/images/favicon.ico" type="image/x-ico"/>
		<meta charset="UTF-8">
		<style type="text/css">
			*{padding:0px;margin:0px;color: #6F6F6F;font-weight: bold;font-size: 12px;}
			header{width: 100%;height: 62px;text-align: center;line-height: 62px;}
			header span{background: url(http://image.monmondecake.com/logo.png) no-repeat;background-size: 20%;width: 30%;height: 102px;position: absolute;left: 5%;top:20px;}
			
			table{width: 90%;margin: 0 5%;border-top: 1px solid #000;border-left: 1px solid #000;border-collapse: collapse;word-break: break-all;word-wrap: break-word;}
		    tr{display: table-row;vertical-align: inherit;border-color: inherit;height: 20px;line-height:20px ;}
		    table td,table th{padding: 1.5mm;border-bottom: 1px solid #000;border-right: 1px solid #000;text-align: left;empty-cells: show;word-break: break-all;}
		    table td{color: #000000;font-weight: bold;}
		    p{width: 90%;margin: 0 5%;margin-top: 5px;line-height: 35px;height: 35px;clear: both;}
		    p b{color: red;}
		    p span{margin-right: 100px;}
		    .black{color: #000000;font-weight: bold;}
			.mt18{margin-top:18px}
			.fr{float: right;}
			.top_msg{
				width: 90%;margin: 0 5% 0 5%;
				height: 40px;
				line-height: 40px;
			}
			.top_msg div{
				float: left;
				width: 25%;
				text-align: left;
			}
			.bnone{border-bottom:none}
			.noprint{
               margin:10px;margin-top:15px;padding:10px;background:#F5F6F7;border:1px solid #BDBDBD;padding:8px;
             }
           .noprint input{
                padding:4px;border:1px solid #3F74D0; left: 5%;
             }
		</style>
		<style type="text/css" media="print">
           .noprint {
	             display: none;
            }
        </style>
	</head>
	<body>		
		<header><span></span>提发货交接单</header>
		<section>
			<div class="top_msg">
				<div>
					日期：${nowDate}
				</div>
				<div>发货人：</div>
				<div>提货方:安家宅配</div>
				<div>发货编号：</div>
			</div>
			
			<table>
				<tr>
					<th>序号</th>
					<th>订单编号</th>
					<th>订单编码</th>
					<th>商品名称</th>
					<th>商品编码</th>
					<th>商品类型</th>
					<th>商品尺寸</th>
					<th>商品重量</th>
					<th>商品数量</th>
					<th>地址</th>
					<th>电话</th>
					<th>收货人</th>
				</tr>
				<c:set var="goodsNum" value="0"></c:set>
				<c:forEach items="${orderList}" var="order" varStatus="count">
					<c:forEach items="${order.goodsList}" var="detail" varStatus="detailCount">
					<tr>
						<c:if test="${detailCount.index == 0}">
						<td rowspan="${fn:length(order.goodsList)}">${count.index+1}</td>
						<td rowspan="${fn:length(order.goodsList)}">${order.id}</td>
						<td rowspan="${fn:length(order.goodsList)}">${order.orderCode}</td>
						</c:if>
						
						<td>${detail.goodsName}</td>
						<td>${detail.goodsCode}</td>
						<td>
							<c:if test="${detail.goodsType == 0}">商品</c:if>
							<c:if test="${detail.goodsType == 1}">配件</c:if>
						</td>
						<td>${detail.goodsSize}</td>
						<td>${detail.goodsWeight}</td>
						<td>${detail.goodsNumber}</td>
						<c:set var="goodsNum" value="${goodsNum+detail.goodsNumber }"></c:set>
						<c:if test="${detailCount.index == 0}">
						<td rowspan="${fn:length(order.goodsList)}">${order.consignAddress}</td>
						<td rowspan="${fn:length(order.goodsList)}">${order.consignPhone}</td>
						<td rowspan="${fn:length(order.goodsList)}">${order.consignee}</td>
						</c:if>
					</tr>
					</c:forEach>
				</c:forEach>
			</table>
		</section>
		<p><span class="fr">商品总数：${goodsNum}</span><span class="fr">订单总数：${fn:length(orderList)}</span></p>
		<p>发货人签字：<span class="fr">提货方签字：</span></p>
		<p>日期：<span class="fr">日期：</span></p>
		<div class="noprint">
		   <input type=button value="打 印" class='input_an2' 
			onclick="window.print();" /> <input type=button value="关 闭"
			class='input_an2'  onclick="window.close();" />
		</div>
	</body>
</html>